#ifndef __MESSAGE_DIALOG_H__
#define __MESSAGE_DIALOG_H__

#include "gofgame/common/ui/Dialog.h"
#include "gofgame/common/ui/MessageButtonType.h"
#include "gofgame/common/ui/MessageDialogType.h"

namespace gofgame {
	namespace common {
		namespace ui {
			class MessageDialog : public Dialog {
			public:
				MessageDialog(MessageDialogType messageDialogType = MessageDialogType_OK);
				virtual bool init();
				
				MessageDialogType getMessageDialogType() const;

				virtual float getButtonHeight() const;
				virtual void setButtonHeight(float buttonHeight);

				virtual const char *getMessage() const;
				virtual void setMessage(const char *message);
				virtual const char *getOKText() const;
				virtual void setOKText(const char *okText);
				virtual const char *getCancelText() const;
				virtual void setCancelText(const char *cancelText);

				virtual Brush *getMessageBrush() const;
				virtual void setMessageBrush(Brush *messageBrush);
				virtual Brush *getButtonBrush(MessageButtonType messageButton = MessageButtonType_Any) const;
				virtual void setButtonBrush(Brush *buttonBrush, MessageButtonType messageButton = MessageButtonType_Any);
				virtual Brush *getButtonBackgroundBrush(MessageButtonType messageButton = MessageButtonType_Any) const;
				virtual void setButtonBackgroundBrush(Brush *buttonBackgroundBrush, MessageButtonType messageButton = MessageButtonType_Any);
				virtual Brush *getButtonPressedBackgroundBrush(MessageButtonType messageButton = MessageButtonType_Any) const;
				virtual void setButtonPressedBackgroundBrush(Brush *buttonPressedBackgroundBrush, MessageButtonType messageButton = MessageButtonType_Any);

			protected:
				virtual Ref<Component> createMainComponent();

			private:
				void okButton_click(void *sender, ComponentEventArgs &e);
				void cancelButton_click(void *sender, ComponentEventArgs &e);

			private:
				Ref<Component> mainComponent;
				Ref<Container> buttonContainer;
				Ref<Button> okButton;
				Ref<Button> cancelButton;
				MessageDialogType messageDialogType;
			};
		}
	}
}

#endif //__MESSAGE_DIALOG_H__
